﻿CREATE FUNCTION dbo.NLin_NSIPayDirect
	(
	@ID int
	)
RETURNS int
AS
	BEGIN
	DECLARE @linksCount int
	
	SELECT @linksCount = COUNT(ID) FROM INVOICE_IN WHERE NSI_PAY_DIRECT_ID = @ID
	
	RETURN @linksCount
	END
